<template>
	<view class="">
		<tn-tabbar :value="currentIndex" :list="tabbarList" activeColor="#838383" inactiveColor="#AAAAAA"
			activeIconColor="#FBBD12" :animation="true" :safeAreaInsetBottom="true" @change="switchTabbar"></tn-tabbar>
	</view>
</template>

<script>
	export default {
		name: 'tabbar',
		props: {
			currentIndex: {
				type: Number,
				default: 0
			}
		},
		data() {
			return {
				// 底部tabbar菜单数据
				tabbarList: [{
						title: '首页',
						activeIcon: '/static/tabbar/home_tnnew.png',
						inactiveIcon: '/static/tabbar/home_tn.png'
					},
					{
						title: '全部分类',
						activeIcon: '/static/tabbar/circle_tnnew.png',
						inactiveIcon: '/static/tabbar/circle_tn.png'
					},
					{
						title: '文案中心',
						activeIcon: 'menu-circle',
						inactiveIcon: 'rocket',
						activeIconColor: '#FFFFFF',
						inactiveIconColor: '#FFFFFF',
						iconSize: 50,
						out: true
					},
					{
						title: '我的设计',
						activeIcon: '/static/tabbar/preferred_tnnew.png',
						inactiveIcon: '/static/tabbar/preferred_tn.png',
					},
					{
						title: '个人中心',
						activeIcon: '/static/tabbar/mine_tnnew.png',
						inactiveIcon: '/static/tabbar/mine_tn.png'
					}
				],
				// 自定义底栏对应页面的加载情况
				tabberPageLoadFlag: [],
				//用户信息
				userinfo: {},
				//用户切换分类
				cateId: 0
			}
		},
		onLoad() {
			
		},
		onShow() {
			
		},
		methods: {
			switchTabbar(e){
				if(e == 1){
					uni.switchTab({
						url:'/pages/Classification/index'
					})
				}else if(e == 2){
					uni.switchTab({
						url:'/pages/Copywriting/index'
					})
				}else if(e == 3){
					uni.switchTab({
						url:'/pages/Mydesign/index'
					})
				}else if(e == 4){
					uni.switchTab({
						url:'/pages/MyCenter/index'
					})
				}else{
					uni.switchTab({
						url:'/pages/index/index'
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
</style>